package com.itheima.mapper;

import org.apache.ibatis.annotations.*;

import java.util.ArrayList;

@Mapper
public interface Setmeal_CheckgroupMapper {

    @Select("select t.checkgroup_id from health_chuanzhi.t_setmeal_checkgroup t where setmeal_id=#{id}")
    ArrayList<Integer> findCheckGroupIdsById(@Param("id") int id);

    @Delete("delete from health_chuanzhi.t_setmeal_checkgroup where setmeal_id=#{id} ")
    void deleteBySetmealId(Integer id);
    @Insert("insert  health_chuanzhi.t_setmeal_checkgroup (setmeal_id, checkgroup_id)"
            +"values (#{setmealId},#{checkgroupId})")
    void addCheckGroup(Integer setmealId,int checkgroupId);
@Select("select count(*) from health_chuanzhi.t_setmeal_checkgroup where checkgroup_id = #{checkgroupId}")
    Integer countByCheckGroupId(int id);

}
